package com.baobao.domain;

import java.io.Serializable;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class AddressPK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public AddressPK() {
	}

	/**
	 */

	@Column(name = "phone", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String phone;
	/**
	 */

	@Column(name = "banji_id", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String banjiId;

	/**
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 */
	public String getPhone() {
		return this.phone;
	}

	/**
	 */
	public void setBanjiId(String banjiId) {
		this.banjiId = banjiId;
	}

	/**
	 */
	public String getBanjiId() {
		return this.banjiId;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((phone == null) ? 0 : phone.hashCode()));
		result = (int) (prime * result + ((banjiId == null) ? 0 : banjiId.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof AddressPK))
			return false;
		AddressPK equalCheck = (AddressPK) obj;
		if ((phone == null && equalCheck.phone != null) || (phone != null && equalCheck.phone == null))
			return false;
		if (phone != null && !phone.equals(equalCheck.phone))
			return false;
		if ((banjiId == null && equalCheck.banjiId != null) || (banjiId != null && equalCheck.banjiId == null))
			return false;
		if (banjiId != null && !banjiId.equals(equalCheck.banjiId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("AddressPK");
		sb.append(" phone: ").append(getPhone());
		sb.append(" banjiId: ").append(getBanjiId());
		return sb.toString();
	}
}
